>>Background Subtraction Method using Open CV:-

Background subtraction (BS) is a common and mostly used technique for generating the foreground mask by using static cameras or surveillance cameras to get the input data and then converting the background of the object into a binary image that contains pixels that belongs to the moving object like, people, cars, trees etc. in the image or video frame which has been given as input data.

According to the method, Background subtraction calculates the foreground mask by doing the subtraction between the current frame and the background frame in the input video or image frame, that contains the static part of the data or anything that is present in the input frame.

  
Background Subtraction has several use cases in everyday life, It is being used for object segmentation, security enhancement, pedestrian tracking, counting the number of visitors, number of vehicles in traffic etc. It is able to learn and identify the foreground mask.

As the name suggests, it is able to subtract or eliminate the background portion inside an image. The output of the Image Frame is a binary segmented image which essentially gives information about the non-stationary objects in the image. There lies a problem in this concept of finding non-stationary portion, as the shadow of the moving object can be moving and sometimes being classified in the foreground.

>>The Python Programming tool on which I worked on is pycharm software and using OpenCV.

>>Steps to import packages(Opencv, etc) in your project in Pycharm Software:-
#To import these packages you need to go to file -> Setting->Project Interpreter.
#After that click on the plus icon to add packages and search for the package you want to include in your project.
The Background subtraction algorithm I used is BackgroundSubtractorMOG2:-
It uses the same concept of Gaussian Blur and BackgroundSubtractorMOG but the major advantage that it provides is in terms of stability whenever there is a change in luminosity and better identification capability of detecting and highlighting shadows in frames.